Initial Semantics for higher-order typed syntax

نویسندگان

  • Benedikt Ahrens
  • Julianna Zsido
چکیده

We present an initial semantics result for typed higher-order syntax based on monads and modules over monads. The notion of module generalizes the substitution structure of monads. For a simply typed binding signature S we define a representation of S to be a monad equipped with a morphism of modules for each of its arities. The monad of abstract syntax of S then is the initial object in the category of representations of S, and the constructors are module morphisms. Our theory is implemented and proved correct in the proof assistant Coq, making heavy use of dependent types. The monadic theory gives rise to an implementation of syntax where both terms and variables are intrinsically typed. Terms are implemented as doubly parametrized data types, dependent on a typed set of variables as well as on object types. The implementation is fully constructive. Given any signature, the implementation automatically provides the initial representation, recursion principles, a certified substitution operation and – via initiality – a morphism towards any other representation of S.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Generalisation of Pre-logical Predicates to Simply Typed Formal Systems

We generalise the notion of pre-logical predicates [HS02] to arbitrary simply typed formal systems and their categorical models. We establish the basic lemma of pre-logical predicates and composability of binary pre-logical relations in this generalised setting. This generalisation takes place in a categorical framework for typed higher-order abstract syntax and semantics [Fio02,MS03].

متن کامل

Functional programming with dependently-typed higher-order data

This paper explores a new point in the design space of functional programming: functional programming with dependently typed higher-order data structures described in the logical framework LF. This allows us to program with proofs. The contributions of this paper are twofold: First, we present a syntax-directed bidirectional type system that distinguishes between dependently typed data and comp...

متن کامل

Initial Semantics for higher-order typed syntax in Coq

Initial Semantics aims at characterizing the syntax associated to a signature as the initial object of some category. We present an initial semantics result for typed syntax with variable binding together with its formalization in the Coq proof assistant. The main theorem was first proved on paper in the second author’s PhD thesis in 2010, and verified formally shortly afterwards. To a simply–t...

متن کامل

A Case Study on Logical Relations using Contextual Types

Proofs by logical relations play a key role to establish rich properties such as normalization or contextual equivalence. They are also challenging to mechanize. In this paper, we describe the completeness proof of algorithmic equality for simply typed lambda-terms by Crary where we reason about logically equivalent terms in the proof environment Beluga. There are three key aspects we rely upon...

متن کامل

Mechanizing Proofs with Logical Relations – Kripke-style

Proofs with logical relations play a key role to establish rich properties such as normalization or contextual equivalence. They are also challenging to mechanize. In this paper, we describe two case studies using the proof environment Beluga: first, we explain the mechanization of the weak normalization proof for the simply-typed lambda-calculus; second, we outline how to mechanize the complet...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • CoRR

دوره abs/1012.1010  شماره 

صفحات  -

تاریخ انتشار 2010